home *** CD-ROM | disk | FTP | other *** search
- echo off
- goto start
- rem SSSGO.BAT
- rem Batch file to run simulation for Microsoft languages
- rem
- rem Author: M. A. Pollatschek
- rem
- rem IMPORTANT NOTE
- rem
- rem THIS PROCEDURE, ITS USE, OPERATION AND SUPPORT IS PROVIDED "AS IS"
- rem WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,BUT
- rem NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
- rem FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND
- rem PERFORMANCE OF THIS PROGRAM IS WITH THE USER. IN NO EVENT SHALL
- rem THE AUTHOR AND/OR THE PUBLISHER BE LIABLE FOR ANY DAMAGES INCLUDING,
- rem WITHOUT LIMITATION, ANY LOST PROFITS, LOST SAVINGS OR OTHER INCIDENTAL
- rem OR CONSEQUENTIAL DAMAGES ARISING THE USE OR INABILITY TO USE SUCH
- rem PROGRAM, EVEN IF THE AUTHOR AND/OR THE PUBLISHER BEEN ADVISED OF THE
- rem POSSIBILITY OF SUCH DAMAGES OR FOR ANY CLAIM BY ANY OTHER PARTY.
- :assume
- echo Assumptions:
- echo
- echo * Running from hard disk
- echo * CHECKING.EXE, DOT_IN.EXE, %2.* and SSSM.LIB are on current directory
- echo (* = BAS or C or FOR or PAS according to %1)
- echo * Language libraries (including LLIBCE.LIB) is on current directory or on
- echo directory written after LIB= in the environment table
- echo * The compiler and LINK.EXE are either in the current directory or
- echo on directory written after PATH= in the environment table
- echo
- echo Remarks:
- echo
- echo * LLIBCE.LIB can be constructed from QuickC package from Microsoft,
- echo follow the instruction of Microsoft documentation. You do NEED
- echo QuickC even if you do not use it otherwise
- echo * Should LINK for FORTRAN report errors, try to change order of
- echo libraries: SSS+LLIBFORE+LLIBCE. Note that original LLIBFORE.LIB of
- echo versions 4.00 and 4.01 MUST BE upgraded - see details in QuickC package
- echo * The environment table can be seen if you type SET from DOS
- goto end
- :usage
- echo Usage: SSSGO language program
- echo
- echo Where language is one of B C F P QB QC (must be UPPERCASE!)
- echo program is program base name WITHOUT extension (like EX_0201)
- goto end
- :start
- if "%1" == "" goto usage
- if "%2" == "" goto usage
- echo Checking files...
- if exist CHECKING.EXE goto libch2
- echo SSSGO: CHECKING.EXE is needed in current directory. Please, copy it.
- echo
- goto assume
- :libch2
- if exist DOT_IN.EXE goto libch3
- echo SSSGO: DOT_IN.EXE is needed in current directory. Please, copy it.
- echo
- goto assume
- :libch3
- if exist LLIBCE.LIB goto lnkchk
- Checking LLIBCE.LIB in LIB
- if not errorlevel 1 goto lnkchk
- echo SSSGO: LLIBCE.LIB is not found.
- echo
- goto assume
- :lnkchk
- if exist LINK.EXE goto extch
- Checking LINK.EXE in PATH
- if not errorlevel 1 goto extch
- echo SSSGO: LINK.EXE is not found.
- echo
- goto assume
- :extch
- dot_in %2
- if not errorlevel 1 goto sssch
- echo SSSGO: %2 has an extension - it should not
- echo
- goto usage
- :sssch
- if exist SSSM.LIB goto lang
- echo SSSGO: SSSM.LIB is not found on current directory
- echo
- echo If you have not build it, please do with SSSLIB.BAT
- goto end
- :lang
- if %1 == QC goto qclang
- if %1 == QB goto qblang
- if %1 == B goto oklangb
- if %1 == C goto oklangc
- if %1 == F goto oklangf
- if %1 == P goto oklangp
- echo SSSGO: first argument is wrong or not uppercase
- echo
- goto usage
- :qclang
- if exist QCL.EXE goto qcl1
- Checking QCL.EXE in PATH
- if not errorlevel 1 goto qcl1
- echo SSSGO: QCL.EXE is not found
- echo
- goto assume
- :qcl1
- if exist %2.C goto qcl2
- echo SSSGO: %2.C is not found on current directory
- goto end
- :qcl2
- echo on
- QCL -c -AL %2.C
- echo off
- echo Going to link. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- echo on
- LINK /NOE %2,,NUL,SSSM+LLIBCE;
- echo off
- goto tryrun
- :qblang
- if exist BC.EXE goto bc1
- Checking BC.EXE in PATH
- if not errorlevel 1 goto bc1
- echo SSSGO: BC.EXE is not found
- echo
- goto assume
- :bc1
- if exist %2.BAS goto bc2
- echo SSSGO: %2.BAS is not found on current directory
- goto end
- :bc2
- echo on
- BC %2/E/X/O/T/C:512;
- echo off
- echo Going to link. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- if exist BCOM45.LIB goto bc3
- Checking BCOM45.LIB in LIB
- if not errorlevel 1 goto bc3
- echo SSSGO: BCOM45.LIB cannot be found
- echo
- goto assume
- :bc3
- echo on
- LINK /EX/NOE %2,,NUL,BCOM45+SSSM+LLIBCE;
- echo off
- goto tryrun
- :oklangb
- if exist BL.EXE goto bl1
- Checking BL.EXE in PATH
- if not errorlevel 1 goto bl1
- echo SSSGO: BL.EXE is not found
- echo
- goto assume
- :bl1
- if exist %2.BAS goto bl2
- echo SSSGO: %2.BAS is not found on current directory
- goto end
- :bl2
- echo on
- BL -c -AL %2.BAS
- echo off
- echo Going to link. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- echo on
- LINK /NOE %2,,NUL,SSSM+LLIBCE;
- echo off
- goto tryrun
- :oklangc
- if exist CL.EXE goto cl1
- Checking CL.EXE in PATH
- if not errorlevel 1 goto cl1
- echo SSSGO: CL.EXE is not found
- echo
- goto assume
- :cl1
- if exist %2.C goto cl2
- echo SSSGO: %2.C is not found on current directory
- goto end
- :cl2
- echo on
- CL -c -AL %2.C
- echo off
- echo Going to link. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- echo on
- LINK /NOE %2,,NUL,SSSM+LLIBCE;
- echo off
- goto tryrun
- :oklangf
- if exist FL.EXE goto fl1
- Checking FL.EXE in PATH
- if not errorlevel 1 goto fl1
- echo SSSGO: FL.EXE is not found
- echo
- goto assume
- :fl1
- if exist %2.FOR goto fl2
- echo SSSGO: %2.FOR is not found on current directory
- goto end
- :fl2
- echo on
- FL -c -AL -FPi %2.FOR
- echo off
- echo Going to link. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- if exist LLIBFORE.LIB goto fl3
- Checking LLIBFORE.LIB in LIB
- if not errorlevel 1 goto fl3
- echo SSSGO: LLIBFORE.LIB is not found
- echo
- goto assume
- :fl3
- echo on
- LINK /EX/NOE/NOD %2,,NUL,SSSM+LLIBCE+LLIBFORE;
- echo off
- goto tryrun
- :oklangp
- echo on
- if exist PL.EXE goto pl1
- Checking PL.EXE in PATH
- if not errorlevel 1 goto pl1
- echo SSSGO: PL.EXE is not found
- echo
- goto assume
- :pl1
- if exist %2.PAS goto pl2
- echo SSSGO: %2.PAS is not found on current directory
- goto end
- :pl2
- PL -c -AL %2.PAS
- echo off
- echo Going to link. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- echo on
- LINK /NOE %2,,NUL,SSSM+LLIBCE;
- echo off
- :tryrun
- echo Going to run %2. You may abort with Control-C.
- pause
- if errorlevel 1 goto nearend
- echo on
- %2
- echo off
- :nearend
- echo Going to erase EXE and OBJ (if exist). You can abort now by Contol-C.
- pause
- if exist %2.EXE erase %2.EXE
- if exist %2.OBJ erase %2.OBJ
- :end
-